#pragma once

#include <vector>
#include <unordered_map>

#include "polygon.h"


struct Fence {


public:
  inline Fence (s32 _id, s32 _flags) noexcept : id(_id), flags(_flags) {
  }

  bool addShape (const f64 *data, u64 size) noexcept;

  bool contains (const f64 *data, u64 size, std::vector<u8> &res) noexcept;


private:
  void _contains (u8 result[4], f64v4 x, f64v4 y) noexcept;


private:
  std::vector<Polygon> shapes;

  s32 id;
  s32 flags;
};
